#!/bin/sh

. server_config.sh

FILENAME="$1"
TIMELIMIT="$2"

PIDFILE="/tmp/$USER-testclient.pid"
echo pidfile is $PIDFILE

if [ "$FILENAME" = "" ]; then
    echo Usage: runlocaltest.sh filename [timelimit] 
else
    echo Workload file is $FILENAME.

    if [ -e $PIDFILE ]; then
        rm -f $PIDFILE
    fi
    exec $JAVA_CMD ca.uvic.group2.testHarness.Main --remote $FILENAME $TIMELIMIT &
    echo $! > $PIDFILE
    echo PID is `cat $PIDFILE`
    fg
fi

